<template>
  <div class="order-view">
    <el-button type="text" @click="dialogVisible = true">{{
      data.orderId
    }}</el-button>
    <el-dialog
      title="采购订单 - 详情"
      :visible.sync="dialogVisible"
      width="80%"
      :before-close="handleClose"
      :modal-append-to-body="false"
      :append-to-body="true"
    >
      <!-- <template>
        <div>
          <el-descriptions title="1213">
            <el-descriptions-item label="单据编号">{{
              data.orderId
            }}</el-descriptions-item>
            <el-descriptions-item label="单据日期">{{
              createDate
            }}</el-descriptions-item>
            <el-descriptions-item label="供应商">{{
              supplier
            }}</el-descriptions-item>
            <el-descriptions-item label="部门">{{
              department
            }}</el-descriptions-item>
            <el-descriptions-item label="业务员">{{
              staff
            }}</el-descriptions-item>
            <el-descriptions-item label="状态">{{
              statusName
            }}</el-descriptions-item>
            <el-descriptions-item label="数量">{{
              count
            }}</el-descriptions-item>
            <el-descriptions-item label="金额">{{
              money
            }}</el-descriptions-item>
            <el-descriptions-item label="审批人">{{
              approver
            }}</el-descriptions-item>
          </el-descriptions>
        </div>
      </template> -->
      <PurchaseOrderDetailTable :data="data"/>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import PurchaseOrderDetailTable from "./PurchaseOrderDetailTable.vue";

export default {
  props: ["data"],
  components: { PurchaseOrderDetailTable },
  data() {
    name: "PurchaseOrderView";
    return {
      dialogVisible: false,
    };
  },
  mounted(){
    console.log("PurchaseOrderView data",this.data)
  },
  methods: {
    handleClose(done) {
      done();
    },
  },
};
</script>